<template>
	<view>
		<view class="double"  >
			<image class="message-icon"  src="/static/img/message-error.png" @tap="reSend(item.problemResult,index,item.sendType)" 
			      :style="{'height':   !(item.error == undefined ? false : item.error)? '0px':'30rpx','width':   !(item.error == undefined ? false : item.error)? '0px':'30rpx' }"     ></image> 
			<image class="message-icon message-icon-loading" src="/static/img/loading.gif"  :animation="rotateLoadingData"
			 :style="{'height':   !(item.loading == undefined ? false : item.loading)? '0px':'30rpx','width':   !(item.loading == undefined ? false : item.loading)? '0px':'30rpx' }"  ></image> 
			 <text class="right-message">{{ item.problemResult }}</text> 
		</view> 
	</view>
</template>

<script>
	export default {
		name:"rebot-send-message",
		props:{
			item :{
				type:Object,
				require:true,
				default:{}
			},
			index:{
				type:Number,
				require:true,
				default:0,
				}
		},
		data() {
			return {
				
			};
		},
		methods:{
			reSend(message,index,type){ 
				console.log(message)
				uni.$emit("sendMessageMonitor",{
					message:message,
					addMessage:false,
					index:index, 
					type:type,
					commentId:null,
					hotMsgIndex:null
				}) 
			},
		}
	}
</script>

<style lang="scss">
	.double { 
		display: flex;
		flex-direction: row;
		justify-content: flex-end;
		align-items: center; 
		margin-top: 15rpx;  
		max-width: 720rpx;  
		
		.right-message {
			margin: 0;
			border-radius: 14rpx;
			background-color: #5074fa; 
			border: 1rpx solid rgba(187, 187, 187, 0.5294117647);
			/* overflow: hidden; */
			padding: 0 20rpx;
			font-size: 18rpx;
			font-family: AppleColorEmoji;
			color: #ffffff;
			white-space: nowrap;
			text-overflow: ellipsis;
			line-height: 56rpx;
			max-width: 500rpx;
			
		}
		.right-message-text{
			font-size: 18rpx;
			font-family: AppleColorEmoji;
			color: #ffffff;
			white-space: nowrap;
			text-overflow: ellipsis;
			line-height: 56rpx;
			max-width: 500rpx;
		}
	}
		 

</style>